From 5215f72bd7986b8d869b50ca106165054fe80d53 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Wed, 9 Mar 2011 14:15:43 -0500 Subject: [PATCH] notebook: add an 'initial-gap' style property It adds a gap before the first tab in the notebook. https://bugzilla.gnome.org/show_bug.cgi?id=643841 --- gtk/gtknotebook.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index e601bb7205..572ad69c36 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -903,6 +903,23 @@ gtk_notebook_class_init (GtkNotebookClass *class) 0, GTK_PARAM_READABLE)); + /** + * GtkNotebook:initial-gap: + * + * The "initial-gap" property defines the minimum size for the initial + * gap between the first tab. + * + * Since: 3.2 + */ + gtk_widget_class_install_style_property (widget_class, + g_param_spec_int ("initial-gap", + P_("Initial gap"), + P_("Initial gap before the first tab"), + 0, + G_MAXINT, + 0, + GTK_PARAM_READABLE)); + /** * GtkNotebook::switch-page: * @notebook: the object which received the signal. @@ -5276,6 +5293,7 @@ gtk_notebook_tab_space (GtkNotebook *notebook, gint i; guint border_width; GtkBorder padding; + gint initial_gap; widget = GTK_WIDGET (notebook); children = priv->children; @@ -5287,6 +5305,7 @@ gtk_notebook_tab_space (GtkNotebook *notebook, "arrow-spacing", &arrow_spacing, "scroll-arrow-hlength", &scroll_arrow_hlength, "scroll-arrow-vlength", &scroll_arrow_vlength, + "initial-gap", &initial_gap, NULL); border_width = gtk_container_get_border_width (GTK_CONTAINER (notebook)); @@ -5294,6 +5313,9 @@ gtk_notebook_tab_space (GtkNotebook *notebook, gtk_widget_get_allocation (widget, &allocation); + allocation.x += initial_gap; + allocation.width -= 2 * initial_gap; + switch (tab_pos) { case GTK_POS_TOP: -- 2.30.2